#ifndef __DYNAMICARRAY_H_
#define __DYNAMICARRAY_H_
#include<stdio.h>
#include<stdlib.h>
#include<stdbool.h>
#define ElementType void* //万能动态数组 //如果需要字符数组，把int改为char就行


struct  DynamicArray;//结构体声明
typedef struct DynamicArray DArray;
DArray* InitDArray();
ElementType FindByElement(DArray *a,ElementType value,bool(*compare)(ElementType,ElementType));
ElementType DeleteElement(DArray *a, ElementType value, bool(*compare)(ElementType, ElementType));
void ClearDArray(DArray *a,void(*clear)(ElementType));
void InsertDArray(DArray *a,ElementType element);
void FastSort(DArray *a,bool(*compare)(ElementType, ElementType));
ElementType BinarySearch(DArray *a,ElementType value,int(*compare)(ElementType, ElementType));
void PrintDArray(DArray *a,void(*print)(ElementType));
#endif